﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using mamnontuoitho7.AppCode;
using System.Data;

namespace mamnontuoitho7.backend
{
    public partial class ClassDetails : System.Web.UI.Page
    {

        protected Class _class = new Class();
        protected Kid _kid = new Kid();
        protected Teacher _teacher = new Teacher();

        protected DataTable _dttTeacher;
        protected DataTable _dttKid;

        protected String _classID = "";
        protected String _className = "";
        

        protected void Page_Load(object sender, EventArgs e)
        {

            //Check Role Admin
            if (Session["memberID"].ToString() != "" && (ConstantClass.permissionInfo).IndexOf(Session["role"].ToString() + ",") != -1)
            {
                try
                {
                if (Request.QueryString["hidClassID"] != null && Request.QueryString["hidClassName"] != null)
                    {
                        _classID = Request.QueryString["hidClassID"].ToString();
                        _className = Request.QueryString["hidClassName"].ToString();
                        _dttTeacher = _teacher.GetClassTeacher(_classID);
                        _dttKid = _kid.GetClassKids(_classID);
                    }


                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    Response.Redirect(ConstantClass._errorAdminPage);
                }
            }
            else
            {
                Response.Redirect(ConstantClass._errorLoginPage);
            }
        }
    }
}